home *** CD-ROM | disk | FTP | other *** search
/ Programming Windows (5th Edition) / Programming Windows, 5th ed. - Companion CD (097-0002183)(1999).iso / Chap21 / StrProg / StrLib.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-10-09  |  1.1 KB  |  42 lines

  1. /*----------------------
  2.    STRLIB.H header file
  3.   ----------------------*/
  4.  
  5. #ifdef __cplusplus
  6. #define EXPORT extern "C" __declspec (dllexport)
  7. #else
  8. #define EXPORT __declspec (dllexport)
  9. #endif
  10.  
  11.      // The maximum number of strings STRLIB will store and their lengths
  12.  
  13. #define MAX_STRINGS 256
  14. #define MAX_LENGTH  64
  15.  
  16.      // The callback function type definition uses generic strings
  17.  
  18. typedef BOOL (CALLBACK * GETSTRCB) (PCTSTR, PVOID) ;
  19.  
  20.      // Each function has ANSI and Unicode versions
  21.  
  22. EXPORT BOOL CALLBACK AddStringA (PCSTR) ;
  23. EXPORT BOOL CALLBACK AddStringW (PCWSTR) ;
  24.  
  25. EXPORT BOOL CALLBACK DeleteStringA (PCSTR) ;
  26. EXPORT BOOL CALLBACK DeleteStringW (PCWSTR) ;
  27.  
  28. EXPORT int CALLBACK GetStringsA (GETSTRCB, PVOID) ;
  29. EXPORT int CALLBACK GetStringsW (GETSTRCB, PVOID) ;
  30.  
  31.      // Use the correct version depending on the UNICODE identifier
  32.  
  33. #ifdef UNICODE
  34. #define AddString    AddStringW
  35. #define DeleteString DeleteStringW
  36. #define GetStrings   GetStringsW
  37. #else
  38. #define AddString    AddStringA
  39. #define DeleteString DeleteStringA
  40. #define GetStrings   GetStringsA
  41. #endif
  42.